<%--
  Created by IntelliJ IDEA.
  User: Singer_YDW
  Date: 2016/12/3
  Time: 11:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<ul id="menu" class="sidebar-menu">
    <c:set var="firstMenu" value="false"/>
    <c:set var="menuList" value="${fns:getMenuList()}"/>
    <li class="header">主导航</li>
    <c:forEach items="${menuList}" var="menu" varStatus="idxStatus">
        <c:if test="${menu.parent.id eq '1'&&menu.isShow eq '1'}">
            <li class="${not empty firstMenu && firstMenu ? 'active' : ''} treeview">
                <a href="javascript:void(0);">
                    <i class=""></i> <span>${menu.name}</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu" id="collapse-${menu.id}">
                    <c:forEach items="${menuList}" var="menu2">
                        <c:if test="${menu2.parent.id eq menu.id&&menu.isShow eq '1'}">
                            <li class="${not empty firstMenu && firstMenu ? 'active' : ''} treeview">
                                <c:if test="${empty menu2.href}">
                                    <a href="javascript:void(0);">
                                        <i class="fa fa-circle-o"></i> <span>${menu2.name}</span>
                                        <span class="pull-right-container">
                                      <i class="fa fa-angle-left pull-right"></i>
                                    </span>
                                    </a>
                                    <ul class="treeview-menu" id="collapse-${menu2.id}">
                                        <c:forEach items="${menuList}" var="menu3">
                                            <c:if test="${menu3.parent.id eq menu2.id&&menu.isShow eq '1'}">
                                                <li class="${not empty firstMenu && firstMenu ? 'active' : ''} treeview">
                                                    <c:if test="${empty menu3.href}">
                                                        <a href="javascript:void(0);">
                                                            <i class="fa fa-circle-o"></i>
                                                            <span>${menu3.name}</span>
                                                            <span class="pull-right-container">
                                                          <i class="fa fa-angle-left pull-right"></i>
                                                        </span>
                                                        </a>
                                                        <ul class="treeview-menu"
                                                            id="collapse-${menu3.id}">
                                                        </ul>
                                                    </c:if>
                                                    <c:if test="${not empty menu3.href}">
                                                        <a href="${fn:indexOf(menu3.href, '://') eq -1 ? ctx : ''}${menu3.href}"
                                                           data-id="${menu3.id}" target="mainFrame">
                                                            <i class="fa fa-circle-o"></i>
                                                            <span>${menu3.name}</span>
                                                        </a>
                                                    </c:if>
                                                </li>
                                            </c:if>
                                        </c:forEach>
                                    </ul>
                                </c:if>
                                <c:if test="${not empty menu2.href}">
                                    <a href="${fn:indexOf(menu2.href, '://') eq -1 ? ctx : ''}${menu2.href}"
                                       data-id="${menu2.id}" target="mainFrame">
                                        <i class="fa fa-circle-o"></i> <span>${menu2.name}</span>
                                        <span class="pull-right-container"></span>
                                    </a>
                                </c:if>
                            </li>
                        </c:if>
                    </c:forEach>
                </ul>
            </li>
            <c:if test="${firstMenu}">
                <c:set var="firstMenuId" value="${menu.id}"/>
            </c:if>
            <c:set var="firstMenu" value="false"/>
        </c:if>
    </c:forEach>
</ul>